package com.bwie.service.impl;

import com.bwie.mapper.CustomerMapper;
import com.bwie.pojo.dto.CustomerDto;
import com.bwie.pojo.po.NameNum;
import com.bwie.pojo.vo.CustomerVo;
import com.bwie.service.CustomerService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class CustomerServiceImpl implements CustomerService {
    @Autowired
    private CustomerMapper customerMapper;

    @Override
    public PageInfo<CustomerVo> getCustomList(CustomerDto customerDto) {
        PageHelper.startPage(customerDto.getPageNum(),customerDto.getPageSize());

        List<CustomerVo> list = customerMapper.getCustomList(customerDto);
        PageInfo<CustomerVo> pageInfo = new PageInfo<>(list);
        return pageInfo;

    }

//    @Override
//    public List<CustomerVo> getCustomListById(List<Integer> ids) {
//        List<CustomerVo> list = customerMapper.getCustomListById(ids);
//        return list;
//
//    }

    @Override
    public List<CustomerVo> getCustomList1(CustomerDto customerDto) {
        List<CustomerVo> list = customerMapper.getCustomList(customerDto);
        return list;
    }

    @Override
    public List<String> getCustomerLevel() {
        List<String> list = customerMapper.getCustomerLevel();


        return list;
    }

    @Override
    public List<Integer> getCustomerLevelNum() {
        List<Integer> list = customerMapper.getCustomerLevelNum();

        return list;
    }

    @Override
    public List<NameNum> getCustomerLevelAndNum() {
        List<NameNum> list = customerMapper.getCustomerLevelAndNum();

        return list;
    }

    @Override
    public List<NameNum> getCustomerSource() {
        List<NameNum> list = customerMapper.getCustomerSource();

        return list;
    }


}
